Initializing virtual machine that subsequently executes application

ABSTRACT

A method and a system for selecting a desired language for text displays in a Java-Type language is provided. A localization class in the loadable Java program defines the text portions of the displays. At start of the application, the Java virtual machine loads this class and a determination is made, by user input or otherwise, of which of a group of languages available should be used for the text. Based on the determination, the static initializer Java-type code is invoked, and it loads the appropriate language text from a markup language document, preferably an XML document. The appropriate text segments from the markup language document are then used to initialize the variables. The application then can proceed to run as usual. Preferably, after the static initialization, the fields of the localization class are checked to confirm that all fields contain text.

This application is a national stage filing under 35 U.S.C. § 371 ofInternational Application No. PCT/EP02/06079, filed Jun. 3, 2002, whichpublished in the English language. This application also claims thebenefit of priority under 35 U.S.C. § 119(a) to European PatentApplication No. 01114123.1, filed Jun. 11, 2001.

FIELD OF THE INVENTION

The present invention relates to systems and methods for providingvarious localized displays for programs, and especially for varyingnatural languages in displays associated with application programswritten in a Java-type language.

BACKGROUND OF THE INVENTION

Almost all computer software applications involve displays shown to theuser, and these displays almost invariably include text in naturallanguage that is appropriate to the location of the system or to auser's preferred natural language.

Software applications are often written in the Java programminglanguage. Java was developed as language that is machine independent andthat is object oriented. Java source code is compiled to a sequence ofinstructions with operation code and operands, the sequence being betterknown as bytecode or binarycode. Bytecode can be loaded and run on avirtual machine (VM). The VM is in fact a software emulation programthat is written for any given computer hardware system. The VM causesthe host computer, whatever its architecture, to emulate a machine thatruns directly on binary code. The application consequently runs on anycomputer “on top of” the VM for that computer. Often, the VM isincorporated in an internet browser program.

Where the application is written in Java, the selection of naturallanguage is accomplished by incorporating texts in various naturallanguages into the source code, for example, as predefined characterstrings. The source code including the character strings is thencompiled to bytecode that is loaded and run.

Corrections to the text are very difficult to make. Current techniquesrequire changing the text in the source code. Re-compiling source codeis time consuming. Also, the translator who writes a translation of thedisplay text needs to have (i) the source code to make any changes, aswell as (ii) an-appropriate source-code editing program. If thetranslator also wishes to test the application, he or she needs (iii)access to the computer.

Besides adapting texts, there are further occasions to configure theapplication. Often, regionalization not only requires translatingnatural languages (e.g., from English to German), but also requiresadapting graphical icons, such as national flag symbols.

Hence, there is an ongoing need for a technical solution that providesmethod, system and computer program for rendering objects on a displaywith automatic loading of the required configuration independent fromsource code.

SUMMARY OF THE INVENTION

The following explanation conveniently uses text objects to be renderedon the display. In general, objects can also be graphical symbols oranything else that is rendered by an application written in javaprogramming language.

In one embodiment, the present invention provides a technical solutionto the above-mentioned problem by providing a localization class(preferably, belonging to the loadable Java program application) thatdefines the text objects of the display. The virtual machine loads theclass and determines, by user input or otherwise, of which of a group ofnatural languages available should be used for the text. Based on thedetermination, an initializer (preferably of Java code) loads the textin the appropriate language from a markup language document (preferably,XML) to initialize the variables in the application. The applicationthen can proceed to run as usual. Displays include text defined by thelocalization class, and the exact strings of characters used in the textare those defined during initialization. Consequently, the user is showndisplays in the appropriate natural language.

Initialization can occur at any time prior to executing the application.Conveniently, initialization takes place when the virtual machine startsoperating, or each time a new user starts using the computer “log on”time). This has the advantage that the virtual machine is readyexecuting any application in the appropriate language. Initializationcan also occur as one of the first steps of the application.

Preferably, after the static initialization, the fields of thelocalization class are checked to confirm that all fields contain text.

In one embodiment, the present invention relates to a computer programproduct having a plurality of instructions for causing a processor of acomputer to initialize a virtual machine that subsequently executes anapplication to render an object on a display of the computer. Thecomputer program product may include instructions for: providing a classthat has a variable, the variable being part of the application;selecting a property value that determines to selectively render theobject from a first object set or from a second object set; reading anobject representation for the variable from a markup language documentin dependence on the property value from a first representation set orfrom a second representation set; and assigning the objectrepresentation to the variable in the class.

It is an advantage of the present invention that objects, variables andproperty values can be stored in different storage locations and can beprovided at different times. Hence, a person who does not haveprogramming skills can still change the objects and property values.Further, the application can be tested with objects of a first set (e.g.original language), wherein further sets can be added at any timewithout modifying the application nor modifying the initializer.

In another embodiment, preferably, the instructions may cause theprocessor to treat the object representation as a pointer to a file.This is convenient if the object has a size that is difficult toaccommodate by the application. The file can be stored in the memory ofthe executing computer or elsewhere on a network computer.

Further, preferably, the instructions may cause the processor to assigna copy of the representation. This is convenient for small sized objectssuch as text objects. Further files are not required.

Additionally, the instructions may cause the processor to receive themarkup language document via the internet. This is convenient forcustomizing the application from a remote computer.

Moreover, preferably, the instructions may cause the processor toperform the step reading by identifying a plurality of variables fromthe byte-code of the application and by subsequently readingrepresentations for at least some of the variables from the markuplanguage document.

It is an advantage that variables to be localized have to be included inthe markup language document only, but do not have to be modified in theapplication. Existing applications can be used as well so thatdown-compatibility is provided. In another embodiment, the presentinvention relates to a method to initialize a virtual machine thatsubsequently executes an application to render an object on a display ofa computer. The method may include: providing a class that has avariable, the variable being part of the application; selecting aproperty value that determines to selectively render the object from afirst object set or from a second object set; reading an objectrepresentation for the variable from a markup language document independence on the property value from a first representation set or froma second representation set; and assigning the object representation tothe variable in the class.

Further, preferably, in the reading step, a plurality of variables maybe identified from the byte-code of the application, and subsequentlyrepresentations may be read for at least some of the variables from themarkup language document.

Additionally, preferably, in the providing step, identification of afurther variable that has already been initiated may be provided and, inthe reading step, a representation for the further variable may be readfrom the markup language document.

Moreover, preferably, in the event that the markup language document haschanged, the method further comprises re-initializing the virtualmachine by: identifying a further representation of the object from themodified markup language document depending on the property value;identifying the corresponding variable for that further representationby parsing the application; and re-initializing the variable accordingto the property value by the object representation object that wasidentified.

In yet another embodiment, the present invention relates to a computersystem that initializes a virtual machine for subsequently executing anapplication that renders an object on a display of a computer. Thesystem may comprise: a class provider as a means for providing a classthat has a variable, the variable being part of the application; aproperty value selector as a means for selecting a property value thatdetermines to selectively render the object from a first object set orfrom a second object set; and a reader as a means for reading an objectrepresentation for the variable from a markup language document independence on the property value from a first representation set or froma second representation set and as a means for assigning the objectrepresentation to the variable in the class.

Further, the reader may identify a plurality of variables from thebyte-code of the application and subsequently may read representationsfor at least some of the variables from the markup language document.

Moreover, the class provider may identify a further variable that hasalready been initiated, and the reader may read a representation for thefurther variable from the markup language document.

Additionally, the system may re-initialize the virtual machine in theevent that the markup language document has changed. Therefore, thesystem may include: means for identifying a further representation ofthe object from the modified markup language document depending on theproperty value; means for identifying the corresponding variable forthat further representation by parsing the application; and means forre-initializing the variable according to the property value for theobject representation object that was identified.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a simplified block diagram of a computer network system;

FIG. 2 is a simplified block diagram of software components in thememory of a computer;

FIG. 3 is a simplified code script of a class provider in anintitializer;

FIG. 4 is a simplified code script of a property value selector in theinitializer;

FIG. 5 is a simplified code script of a reader in the initializer;

FIG. 6 is an example of a markup language document;

FIG. 7 is an example of an application;

FIG. 8 illustrates simplified screen views with objects of theapplication of FIG. 7;

FIG. 9 is a simplified flowchart of a method of the present invention;and

FIG. 10 is a detailed flowchart showing the operation of a computeraccording to a first preferred embodiment the invention.

DETAILED DESCRIPTION

FIG. 1 illustrates a simplified block diagram of computer network system999 having a plurality of computers 900, 901, 902 (or 90 q, with q=0 . .. Q−1, Q any number).

Computers 900-902 are coupled via inter-computer network 990. Computer900 comprises processor 910, memory 920, bus 930, and, optionally, inputdevice 940 and output device 950 (I/O devices, user interface 960). Asillustrated, the invention is present by computer program product 100(CPP), program carrier 970 and program signal 980, collectively“program”.

In respect to computer 900, computer 901/902 is sometimes referred to as“remote computer”, computer 901/902 is, for example, a server, a router,a peer device or other common network node, and typically comprises manyor all of the elements described relative to computer 900. Hence,elements 100 and 910-980 in computer 900 collectively illustrate alsocorresponding elements 10 q and 91 q-98 q (shown for q=0) in computers90 q.

Computer 900 is, for example, a conventional personal computer (PC), adesktop and hand-held device, a multiprocessor computer, a pen computer,a microprocessor-based or programmable consumer electronics, aminicomputer, a mainframe computer, a personal mobile computing device,a mobile phone, a portable or stationary personal computer, a palmtopcomputer or the like.

Processor 910 is, for example, a central processing unit (CPU), amicro-controller unit (MCU), digital signal processor (DSP), or thelike.

Memory 920 symbolizes elements that temporarily or permanently storedata and instructions. Although memory 920 is conveniently illustratedas part of computer 900, memory function can also be implemented innetwork 990, in computers 901/902 and in processor 910 itself (e.g.,cache, register), or elsewhere. Memory 920 can be a read only memory(ROM), a random access memory (RAM), or a memory with other accessoptions. Memory 920 is physically implemented by computer-readablemedia, such as, for example: (a) magnetic media, like a hard disk, afloppy disk, or other magnetic disk, a tape, a cassette tape; (b)optical media, like optical disk (CD-ROM, digital versatile disk—DVD);(c) semiconductor media, like DRAM, SRAM, EPROM, EEPROM, or memorystick.

Optionally, memory 920 is distributed across different media. Portionsof memory 920 can be removable or non-removable. For reading from mediaand for writing in media, computer 900 uses devices well known in theart such as, for example, disk drives, tape drives.

Memory 920 stores support modules such as, for example, a basic inputoutput system (BIOS), an operating system (OS), a program library, acompiler, an interpreter, and a text-processing tool. Support modulesare commercially available and can be installed on computer 900 by thoseof skill in the art. For simplicity, these modules are not illustrated.

CPP 100 comprises program instructions and—optionally—data that causeprocessor 910 to execute method steps of the present invention. Methodsteps are explained with more detail below. In other words, CPP 100defines the operation of computer 900 and its interaction in systemnetwork system 999. For example and without the intention to belimiting, CPP 100 can be available as source code in any programminglanguage, and as object code “binary code”) in a compiled form. Personsof skill in the art can use CPP 100 in connection with any of the abovesupport modules (e.g., compiler, interpreter, operating system).

Although CPP 100 is illustrated as being stored in memory 920, CPP 100can be located elsewhere. CPP 100 can also be embodied in carrier 970.

Carrier 970 is illustrated outside computer 900. For communicating CPP100 to computer 900, carrier 970 is conveniently inserted into inputdevice 940. Carrier 970 is implemented as any computer readable medium,such as a medium largely explained above (cf. memory 920). Generally,carrier 970 is an article of manufacture comprising a computer readablemedium having computer readable program code means embodied therein forexecuting the method of the present invention. Signal 980 travels onnetwork 990 to computer 900.

Having described CPP 100, program carrier 970, and program signal 980 inconnection with computer 900 is convenient. Optionally, program carrier971/972 (not shown) and program signal 981/982 embody computer programproduct (CPP) 101/102 to be executed by processor 911/912 (not shown) incomputers 901/902, respectively.

Input device 940 symbolizes a device that provides data and instructionsfor processing by computer 900. For example, device 940 is a keyboard, apointing device (e.g., mouse, trackball, cursor direction keys),microphone, joystick, game pad, scanner. Although the examples aredevices with human interaction, device 940 can also operate withouthuman interaction, such as, a wireless receiver (e.g., with satellitedish or terrestrial antenna), a sensor (e.g., a thermometer), a counter(e.g., goods counter in a factory). Input device 940 can serve to readcarrier 970.

Output device 950 symbolizes a device that presents instructions anddata that have been processed. For example, a monitor or other type ofdisplay, (cathode ray tube (CRT), flat panel display, liquid crystaldisplay (LCD), a speaker, a printer, a plotter, a vibration alertdevice. Similar as above, output device 950 communicates with the user,but it can also communicate with further computers.

Input device 940 and output device 950 can be combined to a singledevice; any device 940 and 950 can be provided optional.

Bus 930 and network 990 provide logical and physical connections byconveying instruction and data signals. While connections insidecomputer 900 are conveniently referred to as “bus 930”, connectionsbetween computers 900-902 are referred to as “network 990”. Devices 940and 950 are coupled to computer 900 by bus 930 (as illustrated) or bynetwork 990 (optional). While the signals inside computer 900 are mostlyelectrical signals, the signals in network are electrical, magnetic,optical or wireless (radio) signals.

Networking environments (as network 990) are commonplace in offices,enterprise-wide computer networks, intranets and the internet (i.e.world wide web). The physical distance between a remote computer andcomputer 900 is not important. Network 990 can be a wired or a wirelessnetwork. To name a few network implementations, network 990 is, forexample, a local area network (LAN), a wide area network (WAN), a publicswitched telephone network (PSTN); a Integrated Services Digital Network(ISDN), an infra-red (IR) link, a radio link, like Universal MobileTelecommunications System (UMTS), Global System for Mobile Communication(GSM), Code Division Multiple Access (CDMA), or satellite link.

Transmission protocols and data formats are know, for example, astransmission control protocol/internet protocol (TCP/IP), hyper texttransfer protocol (HTTP), secure HTTP, wireless application protocol,unique resource locator (URL), a unique resource identifier (URI), hypertext markup language HTML, extensible markup language (XML), extensiblehyper text markup language (XHTML), wireless application markup language(WML), etc.

Interfaces coupled between the elements are also well known in the art.For simplicity, interfaces are not illustrated. An interface can be, forexample, a serial port interface, a parallel port interface, a gameport, a universal serial bus (USB) interface, an internal or externalmodem, a video adapter, or a sound card.

Computer and program are closely related. As used hereinafter, phrases,such as “the computer provides” and “the program provides”, areconvenient abbreviation to express actions by a computer that iscontrolled by the program.

FIG. 2 is a simplified block diagram of the software components inmemory 920 of computer 900 (cf. FIG. 1): virtual machine (VM) 150 withJava class loader 155, application 200, initializer 250 of the presentinvention (details in FIGS. 3-4) and markup language document 300 of thepresent invention.

The software components form software system 150/200/250/300. Storingthe components in a single memory (e.g., in memory 920 of computer 900)is convenient, but not required. As mentioned in connection with FIG. 1,memory 920 can have physically separated portions. Components can evenbe distributed the different computers. Organizing software components,for example, by files and directories is well known. Bytecode componentsare conveniently stored in “.class” files. Retrieving softwarecomponents from anywhere in memory is well known too and therefore notfurther detailed. VM 150 is conveniently integrated into a browserprogram, well known in the art.

During initialization of VM 150 according to the present invention, onlyinitializer 250 and document 300 need to be present. Application 200 canstill be under development and can be loaded later.

Initializer 250 and markup language document 300 each are referred to ascomputer program product 100. It is an advantage of the presentinvention that initializer 250 and markup language document 300 can beprovided, stored, and modified independently.

Initializer 250 comprises the following components: class provider 251,property value selector 252, reader 253, and optionally tester 254.Markup language document 300 is, preferably, an XML—document (details inFIG. 6). Preferably, application 200 has been compiled to bytecode.FIGS. 3-5 illustrate the components of initializer 250 by code scriptexamples. Reference numbers are added on the left side to convenientlyexplain the scripts. Java source code is used here for explanation,terms like “public”, “private”, static”, “string”, “void”, arewell-known to those of skill in the art and will not be explainedfurther. For convenience, writing by uppercase and lowercase letters isnot distinguished. Since initializer 250 cooperates with virtual machine150, components such as class provider 251, selector 252, reader 253,and tester 254 are stored in bytecode. Persons of skill in the art cancompile these components before without the need explanation herein.

Preferably, components 251, 252, 253, and 254 are called one afteranother. However, the order might change to accommodate modifications:optionally, selector 252 is executed prior to provider 251.

FIG. 3 is a simplified code script of class provider 251 in intitializer250 of FIG. 2. Class provider 251 provides (cf. step 410 in FIG. 9)class 201 having at least one variable, wherein the variable representsan object. Preferably, a plurality of object representing variables isprovided: a first class for a string—variable SAMPLE_STRING (251-3), asecond class for a string—variable SAMPLE_ICON (251-4), and a thirdclass for a class—variable SAMPLE_CLASS (251-5).

SAMPLE_STRING represents a text label object (cf. 310/320 in FIG. 8) bystoring the text to be displayed; SAMPLE_ICON represents an icon (cf.311/321 in FIG. 8) by storing the name of a graphic file (e.g., GIF-typefile). SAMPLE_CLASS represents an object of the type java.lang.classthat represents a java class (not an instance of the class, but theclass itself).

SAMPLE_STRING, SAMPLE_ICON, and SAMPLE_CLASS will be assigned values byreader 253 that evaluates markup language document 300 (cf. FIGS. 5-6).Having 3 different classes “SAMPLE” is convenient for explainingdifferent object types. This is convenient, but not essential for thepresent invention.

Class provider 251 does not yet initialize the classes. In oneembodiment of the present invention, the Java-class “SAMPLE” (cf. line251-1) comprises a further class for a string-variable LANGUAGE (251-2).LANGUAGE will be assigned a value by property value selector 252 (cf.FIG. 4). LANGUAGE is an auxiliary variable for selecting objects butLANGUAGE does not represent the objects. Explaining LANGUAGE as part ofclass 201 is convenient for explanation, but not necessary for thepresent invention, LANGUAGE can be in a different class that isindependent from class 201.

FIG. 4 is a simplified code script of property value selector 252.Selector 252 selects (cf. step 420 in FIG. 9) a property value for thevariable LANGUAGE. Conveniently, selector 252 is implemented by aninstruction sequence that (in Java source code) is defined by a functionnamed “GET_LANGUAGE_PROPERTY” (cf. line 252-1). The assignment ofpredefined values to LANGUAGE determines whether application 200 rendersobjects of a first object set (310, 311, 312) or of a second object set(320, 321, 322).

In the example, selector 252 reads an environment variable (e.g.,“user.language”, cf. line 252-2) that is already set on computer 900.Selector 252 assigns the contents for the environment variable to theproperty value LANGUAGE, such as “en” for English or “de” for German.English “en” is a default value.

Using objects of first and second sets is convenient for explanation;persons of skill in the art can use a plurality with more than two setswithout departing from the present invention.

FIG. 5 is a simplified code script of reader 253. Reader 253 reads (cf.step 430 in FIG. 9) object representations for the objects of theselected object set from a markup language document (GET_VALUES, cf.line 253-1), preferably from markup language document 300 and assigns(cf. step 440) the object representations to the variables of class 201according to the property value (GET_VALUES_FROM_XML_DOCUMENT(LANGUAGE), cf. line 253-2). Conveniently, reader 253 comprises an errorhandling routine (CATCH, cf. line 253-3) known in the art. The functionof reader 253 is now explained in connection with the example of markuplanguage document 300.

FIG. 6 is an example of markup language document 300. Document 300starts with a document type definition (DTD) that is well known in theart. The DTD comprises definitions for elements and attributes; forsimplicity of explanation, only the first definitions lines are givenand further lines are abbreviated by ellipsis.

Markup language document 300 comprises representations of the objects(“object representations”). Object representations are distinguishedinto copy representations (to be copied to the variable) and pointerrepresentations (being a pointer to a file elsewhere). The term“pointer”conveniently stands here for any means to build the object. Themeans can be located outside the class (as in a separate database) orinside the class (embedded).

In the example of FIG. 6, the object representations are: copyrepresentation 310′ for text object 310 (English), copy representation320′ for text object 320 (German), pointer representation 311′ to a file“en.gif” to display graphic object 311 for use in connection withEnglish text, pointer representation 312′ to a file “de.gif” to displaygraphic object 321 for use in connection with German text, as well aspointer representations 312′ and 322′ for objects 312 and 322,respectively.

According to the property value (here: LANGUAGE), reader 253 reads theobject representations 310′, 311′ and 312′ for objects 310, 311, 312 ofa first object set, or reads object representations 320′, 321′, 322′ forobjects 320, 321, 322 of a second object set.

In the example, the sets are distinguished by LANGUAGE being “en” forEnglish in the first set and “de” for German in the second set. Havingread the representations, reader 253 then initializes the variables ofclass 201 by the objects that are represented. In case of the first set,variable SAMPLE_STRING is set to “Welcom”; variable SAMPLE_ICON is setto “en.gif” and variable SAMPLE_CLASS is set to an instance of the classjava.lang.Class (representing the java-class java.lang.Integer).

Persons of skill in the art can implement reader 253 without the need offurther information herein. When the names of the variables and thevalue of LANGUAGE are known, for example, reader 253 can parse untilidentifying the appropriate representations.

It is an advantage of the present invention that changes in the objectsare made in document 300, but not in application 200. For example,correcting the German text “Willkommen” (in object 320) to a more politeform “Herzlich Willkommen” (in object 320) is done document 300 bysimply editing. In other words, application 200 and initializer 250(both in byte-code) remain unchanged. This is an important feature forselling application 200 because it relives customers from modifyingsource code.

In the example of FIG. 6, document 300 conveniently comprises objectrepresentations for English and for German. Persons of skill in the artare able, based on the present invention herein, to use separatedocuments for each language. In this case, reader 253 would selecteither the English document or the German document for furtherprocessing.

As mentioned, markup language document 300 is, preferably, anXML-document; persons of skill in the art can use other markup languageformats that function analogously.

FIG. 7 is an example of application 200 that causes computer 900 toeither render objects 310 and 311 (first set, English) or objects 320and 312 (second set, German) on display 950. It is an advantage that theset selection need not be written into application 200. For convenienceof explanation, instructions that define the position of objects 310/320and 311/312 on display 950 are not explained because such instructionsare well known in the art. As mentioned, application 200 can beavailable in byte-code as well. When the application starts, thevariables (e.g., SAMPLE_STRING, SAMPLE_ICONS, and SAMPLE_CLASS) havealready been initialized with the appropriate objects. It is a furtheradvantage of the present invention that existing applications can beused without modifying them.

FIG. 8 illustrates simplified screen views with objects 310/320 and311/312 of application 200. Display 950-1 illustrates first set objects310 and 311 when initializer 250 initializes with LANGUAGE=en (English);display 950-2 illustrates second set objects 311 and 312 wheninitializer 250 initializes with LANGUAGE=de (German). The naturallanguage of text objects 310 and 320 corresponds to country flags ingraphical objects 311 and 321. It is an advantage of the presentinvention to allow displaying objects in the context of the country forthat the application is designed. Further examples are symbols for localand international currencies.

FIG. 9 is a simplified flow chart diagram of an exemplary method 400 ofthe present invention. In the following, method 400 is described underthe assumption that all steps are performed successfully. Those of skillin the art can introduce checking steps to take appropriate actions incase of failures. FIGS. 4-5 mention such checking by well-knownprogramming statements such as “if”, “try”, “catch”, etc. Method 400describes how initializer 250 (or in general terms: computer programproduct 100) causes processor 910 to initialize virtual machine (VM)150. In other words, processor 910 prepares VM 150 for subsequentprocessing of application 200. Preferably, VM 150 subsequently executesapplication 200 to render an object on display 950 of computer 900.Method 400 to initialize VM 150 comprises the following steps:

providing 410 a class that has a variable, the variable being part ofthe application; selecting 420 a property value that determines toselectively render the object from a first object set or from a secondobject set; reading 430 an object representation for the variable from amarkup language document in dependence on the property value from afirst representation set or from a second representation set; andassigning 440 the object representation to the variable in the class.

Method 400 is executed prior to and independent from application 200.The time between executing method 400 and executing application 200 isnot important; application 200 can follow immediately or after anywaiting time. Also, multiple applications can use the same variables.

The following description follows FIGS. 3-8 for the example of renderingtext object 310 “Welcome”): In step 410, processor 910 provides class201 with variable SAMPLE_STRING (cf. 251-3 in FIG. 3). SAMPLE_STRING ispart of application 200 (cf. 200-1 in FIG. 7). In step 420, processor910 selects property value LANGUAGE=en that determines to render object310 in English. In step 430, processor 910 reads object representation310′ (cf. FIG. 6, “Welcome”) for the variable SAMPLE_STRING from markuplanguage document 300 (cf. FIG. 6) in dependence on the property valueLANGUAGE=“en” from first representation set 310′. In step 440, processor910 assigns the object representation 310′ to variable SAMPLE_STRING inclass 201. In other words, SAMPLE_STRING=“Welcome”. Method 400 is nowfinished; when VM 150 later executes application 200 then object 310 isdisplayed.

In other words, after having performed method 400, virtual machine 150is initialized and ready to execute application 200.

As in the example, processor 910 assigns a copy of representation 310′“Welcome”) to SAMPLE_STRING. This is convenient when the size of theobject can be accommodated by application 200. Optionally, processor 910treats the object representation as a pointer to a file. For example,pointer representations 311′ and 312′ are pointers to files “en.gif”and“de.gif”, respectively.

Optionally, processor 910 receives markup language document 300 orinitializer 250 via the Internet from a server computer. Browser appletsare convenient therefore.

Although various embodiments of the invention have been described inconnection with a single class (cf. FIG. 3) which is convenient forexplanation, it is not limiting. Based on the description herein,persons of skill in the art are now able to introduce further classesand further markup language documents as it might be convenient when theapplication comprises multiple modules.

FIG. 10 is a detailed flowchart showing the operation of computer 900according to the invention in a first preferred embodiment. Application200 starts (step 3) and the code thereof makes a reference (step 5) toclass 201. Starting application 200 at this early time point isconvenient for triggering the next steps, but not required. Thereference to class 201 may be caused by creating an instance of class201, or by accessing one of the static methods or functions of class201.

Class 201 defines the set of all of the text fields displayed to theuser in running application 200. Use of class 201 allows the user toalter the text displayed in the application so as to be appropriate tothe location of usage, or to the individual user's linguisticrequirements. Text-defining localization class document is loaded (step7) by Java class loader 155. If the read fails (decision 9) an exceptionoccurs (terminal step 11). What happens where an exception occurs willdepend on application 200, but most commonly will result in display ofan error message and a failure and exit of application 200, sinceapplication 200 would have no text to put up in any display.

The selection of which available natural language is to be used fordisplay may be made by requesting a user input selecting the language.Once entered, this selection may remain the controlling selection.Alternatively, the selection may be input at every start of theapplication. Other determinations of location may also be used.

If the read is successful, initializer 250 is executed, and markuplanguage document 300, preferably in XML format (step 13) is loaded.Document 300 is parsed using an XML parser, of which several areavailable on the market (e.g., document object model parser). If loadingof document 300 fails (decision 15), an unchecked exception is taken(terminal step 11) and, most preferably, application 200 terminates.

If the load is successful, the variables described in document 300 areinitialized (step 17). For every variable, document 300 contains a name(e.g., SAMPLE_STRING) and a character string value (e.g., “Welcome”).The value is then assigned to the variable with that name in class 201.If the variable represents a more complex data type, additional stepsmay be included before finally assigning the variable value, such as,for example, where an image for an icon is required (cf. en.gif forobject 311). If any part of this procedure fails (decision 19), anexception is also thrown (terminal step 11).

If the initializing step 17 is successful, the variables are thenverified (step 21). Each variable is checked to see if its value is thedefault value (decision 23); if so, then the variable was notinitialized, and an exception 11 is thrown. Otherwise, theinitialization was successful, and the application proceeds (step 25) tonormal operation.

The loading and parsing of document 300, as well as the initializationof the variables is all done automatically when class 201 is referenced(i.e. used the first time). The checking of the variables is thenperformed in a second step to make sure that they are all properlyinitialized. The code for this processing is located in the staticinitializer of the Java class. This code is executed by the Java classloader when the class is loaded, even before the first instance of theclass is created. Since the class loader does the initialization, it isonly done once, and not every time an instance of the class is created.Initialization and verification of the class variables is done beforethe first class is created. This guarantees that all localized variableshave been initialized before the application starts. Any errors ornon-initialized variables are detected before the application starts; sothe application itself does not need to do any additional or extensivechecks in addition to those done at initialization.

A primary benefit of this system is that localized versions of classescan be created and added without needing to change or re-compile (oreven to have a copy of) the Java source code. Any edits or amendments toany translations, such as to correct errors discovered after entry, canbe easily done, since the language text is stored in the XML document.XML documents can be easily edited using a simple text editor, and nospecial tools are needed. In terms of extending the software, thepresent system allows for this easily. If the developer wishes to extenda localized class, he needs only to add a new variable. The checks forthis new variable are performed automatically without the need to writeany additional code.

Also, where a translator wishes to add a new language version forapplication 200, this can be done without the aid of a softwaredeveloper. The translator can simply translate the XML document into anew natural language. The XML parser verifies the completeness of thetranslation of the variables, and the class definition itself verifiesthat a translation of each variable is provided and loaded.

Consequently, a translator can translate, test the translation runningon the application, and include a new language version in theapplication independent of the developer, and completely without need-ofany source code.

In other words, the various embodiments of invention also relate to amethod for providing objects (e.g., texts, icons) in a display forJava-type computer application 200. The method may include providingclass 201 in application 200, class 201 defining objects 310, 320 of thedisplay; providing markup language document 300 (e.g., XML) containing aplurality of object representations 310′, 320′; loading class 201 oncomputer 900 to run application 200; determining which of therepresentations 310′, 320′ is to be used for the display; initializingclass 201 based on the determination with the markup language document300; and running application 200 with class 201 initialized to saidrepresentations.

A second preferred embodiment of the present invention is now described.It can be combined with the first embodiment. Optionally, thisembodiment of the present invention takes advantage of the reflectionfeature in Java, explained, for example, in the following article: “GlenMcCluskey: ‘Using Java Reflection’, January 1998,http://developer.java.sun.com/developer/technicalArticles/ALT/Reflection/”The names of the variables can be retrieved from byte-code.

Optionally, processor 910 perform step reading 430 by identifying aplurality of variables from the byte-code of application 200 and bysubsequently reading representations for at least some of the variablesfrom the markup language document 300.

For example, in a first sub-step, processor 910 identifies a pluralityof variables from the byte-code of application 200. Preferably, this isaccomplished by reflection. In the example of FIG. 7, application 200has variables SAMPLE_STRING and SAMPLE_ICON. Not illustrated, butapplication 200 can have further variables, such as COLOR_SAMPLE toindicate the background illumination of display 950. In a secondsub-step, processor 910 then reads representations 310′ “Welcome”) and311′ (“len.gif”) for variables SAMPLE_STRING and SAMPLE_ICON,respectively, from markup language document 300. The other variableCOLOR_SAMPLE remains unchanged, because it is not included in document300.

Method 400 can comprise an additional step testing 450. Processor 910parses markup language document 300 to verify syntax of the markuplanguage. Syntax errors that are instruced into document 300, forexample, be the translator are indentified.

Describing tester 254 independently from reader 253 is convenient forexplanation, but not necessary for the present invention. Preferably,tester 254 and reader 253 operate in close cooperation; or tester 254and reader 253 form a single unit.

Using reflection, tester 254 optionally (cf. FIG. 254) evaluateapplication 200 to identify the variables used by application 200. Inthe example of FIG. 7, these variables are SAMPLE_STRING andSAMPLE_ICON. In the way described above, information about the existenceof a variable in application 200 is used to selectively initiate thevariable with object representations from document 300 (if representedin document 300). Thereby, object selection takes place according to aproperty value (e.g., LANGUAGE).

Referring back to FIG. 10, reflection is used in steps 17 and 21.

Having described details of method and computer program, the presentinvention is now summarized as a computer system (having at least onecomputer such as computer 900). Computer system 900 initializes virtualmachine 150 for subsequently executing application 200 that rendersobject 310/320 on display 950 of computer 900. Class provider 251 is ameans for providing 410 class 201 that has variable 251-3 (part of theapplication 200); property value selector 252 is a means for selecting420 property value 252-5 that determines to selectively render theobject from first object set 310 or from second object set 320; andreader 253 is a means for reading 430 object representation 310′/311′for the variable from markup language document 300 in dependence on theproperty value from first representation set 310′ or from secondrepresentation set 320′ and is a means for assigning 440 objectrepresentation 310′/311′ to variable 251-3 in class 201.

Preferably, reader 253 identifies a plurality of variables from thebyte-code of application 200 and subsequently reads representations forat least some of the variables from markup language document 300.Preferably, class provider 251 identifies a further variable that hasalready been initiated, and reader 253 reads a representation for thefurther variable from markup language document 300.

Preferably, the computer system re-initializes virtual machine 150 inthe event that markup language document 300 has changed. Therefore, thesystem comprises means for identifying a further representation of theobject from the modified markup language document depending on theproperty value; means for identifying the corresponding variable forthat further representation by parsing application 200; and means forre-initializing 440 the variable according to the property value for theobject representation objects that was identified.

The terms used herein should be considered terms of description ratherthan limitation, as those of skill in the art with this specificationbefore them will be able to make changes and modifications thereinwithout departing from the scope of the claims. In particular, the termJava or Java-type should be understood to embrace any analogouslanguage, e.g., a language that defines classes and initializes them,and not to necessarily be limited to any specific programming languageproduct.

LIST OF REFERENCES

Reference Element 100 computer program product 150 virtual machine (VM)155 class loader 200 application 201 class 250 initializer 251 classprovider 252 property value selector 253 reader 254 tester 300 markuplanguage document 310′, 311′, 312′, object representations 320′. 321′,322′ 310, 311, 320, 321 objects 410 providing class with variable 420selecting property value 430 reading representations 440 assignrepresentations to object 450 testing 900, 901, 902 computer, computersystem 910 processor 920 memory 940 input device 950 output device 960user interface 970 carrier 980, 981, 982 signal 990 network 999 computersystem

1. A computer-readable medium comprising instructions, which, when executed by a processor, cause the processor to perform a method of initializing a virtual machine for rendering an object on a computer display, the method comprising: providing an application; receiving a property value corresponding to an application format; identifying a plurality of variables from a byte-code of the application; reading a plurality of object representations for at least some of the plurality of variables from a markup language document; selecting an object representation from the markup language document according to the application format specified in the property value, wherein the object representation is selected from the plurality of object representations with same meanings and different formats; and assigning the object representation from the markup language document to a variable in the application by assigning the object representation in the markup language document to the variable in the application; re-initializing the virtual machine upon a modification of the markup language document, the re-initializing comprising: identifying a new object representation from the modified markup language document according to the application format specified in the property value; identifying the variable for the new object representation by parsing the application; and re-initializing the variable based on the new object representation.
 2. The computer-readable medium of claim 1, wherein the object representation comprises a pointer to a file.
 3. The computer-readable medium of claim 1, the method further comprising receiving the markup language document via the Internet.
 4. The computer-readable medium of claim 1, wherein the providing further comprises identifying a further variable that has already been initiated and wherein the selecting further comprises reading a representation for the further variable from the markup language document.
 5. The computer-readable medium of claim 1, the method further comprising performing re-initialization while the virtual machine executes the application.
 6. A method for initializing a virtual machine (VM) for rendering an object on a display of a computer, the method comprising: providing an application; receiving a property value corresponding to an application format; identifying a plurality of variables from a byte-code of the application; reading a plurality of object representations for at least some of the plurality of variables from a markup language document; selecting an object representation from the markup language document according to the application format specified in the property value, wherein the object representation is selected from the plurality of object representations with same meanings and different formats; and assigning the object representation from the markup language document to a variable in the application by assigning the object representation in the markup language document to the variable in the application; re-initializing the virtual machine upon a modification of the markup language document, the re-initializing comprising: identifying a new object representation from the modified markup language document according to the application format specified in the property value; identifying the variable for the new object representation by parsing the application; and re-initializing the variable based on the new object representation.
 7. The method of claim 6, wherein the providing an application further comprises identifying a further variable that has already been initiated and wherein reading further comprises reading a representation for the further variable from the markup language document.
 8. A computer system that initializes a virtual machine (VM) for rendering an object on a display of a computer, the computer system comprising: a processor; a computer memory device configured to store an application; a property value selector configured to receive a property value corresponding to an application format; a reader executing on the processor, the reader configured to: identify a plurality of variables from a byte-code of the application, read a plurality of object representations for at least some of the plurality of variables from a markup language document, select an object representation from the markup language document according to the application format specified in the property value, wherein the object representation is selected from the plurality of object representations with same meanings and different formats, and assign the object representation from the markup language document to a variable in the application, by assigning the object representation in the markup language document to the variable in the application; and means for re-initializing the virtual machine upon a modification of the markup language document the means for re-initializing further comprising: means for identifying a new object representation from the modified markup language document according to the application format specified in the property value; means for identifying the variable for the new object representation by parsing the application; and means for re-initializing the variable based on the new object representation.
 9. The computer system of claim 8, wherein the reader is further configured to: identify a further variable that has already been initiated, and read a representation for the further variable from the markup language document.
 10. The computer-readable medium of claim 1, wherein the application format comprises a natural language.
 11. The method of claim 6, wherein the application format comprises a natural language.
 12. The computer system of claim 8, wherein the application format comprises a natural language. 